import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 0
 * Date: 2023-03-15
 * Time: 14:19
 */
public class Test {

    public static void main(String[] args) {
        int[] nums = {2,7,11,15};
        int[] array = twoSum(nums,13);
        System.out.println(Arrays.toString(array));
    }

    public static int[] twoSum(int[] nums,int target) {
        int[] ret = new int[]{-1,-1};
        for (int i = 0; i < nums.length-1; i++) {
            for (int j = i+1; j < nums.length; j++) {
                if(target == (nums[i] + nums[j])) {
                    ret[0] = i;
                    ret[1] = j;
                    return ret;
                }
            }
        }
        return null;
    }

    public static void main2(String[] args) {
        int[] array = {2,7,11,15};

    }

    public static boolean isOddthreenum(int[] array) {
        int i = 0;
        int count = 0;
        while(i < array.length) {
            if(array[i] %2 != 0) {
                count++;
            }else {
                count = 0;
            }
            if(count == 3) {
                int[] array2 = new int[]{array[i-2],array[i-1],array[i]};
                System.out.println(Arrays.toString(array2));
                return true;
            }
            i++;
        }
        return false;
    }



    public static void main1(String[] args) {
        int[] array = {2,2,1,1,1,2,2};
        Arrays.sort(array);
        System.out.println(array[array.length/2]);

    }

    public static int fun(int[] array) {
        int sum = array[0];
        for (int i = 1; i < array.length; i++) {
            sum ^= array[i];
        }
        return sum;
    }
}

